/**
 * 
 */
package org.rollinitiative.d20.entity.races;

import java.io.Serializable;
import java.util.ArrayList;

import javax.persistence.CascadeType;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.xml.bind.annotation.*;

import org.rollinitiative.d20.encounter.combat.actions.ActionOptions;
import org.rollinitiative.d20.entity.Movement;
import org.rollinitiative.d20.entity.Size;

/**
 * @author bebopjmm
 * 
 */
@SuppressWarnings("serial")
@Entity
@XmlRootElement(name = "Race", namespace = "java:org.rollinitiative.d20.entity")
@XmlType(name = "RaceType", namespace = "java:org.rollinitiative.d20.entity")
public class Race implements Serializable
{

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long persistID;

    private String name;

    private Size size;

    private String id;

    @OneToOne(cascade = CascadeType.ALL)
    private RacialClassification classification;

    @Embedded
    private Movement movement;

//    private CombatOptions combatOptions;

//    private Advancement advancement;


    public Race()
    {
        this.name = "";
        this.id = new String("default");
        this.movement = new Movement();
        this.classification = new RacialClassification();
//        this.combatOptions = new CombatOptions();
    }
    
    public Race (String name, Size size, RacialClassification classification, Movement movement)
    {
        this.name = name;
        this.size = size;
        this.classification = classification;
        this.movement = movement;
    }


    public String getName()
    {
        return name;
    }


    @XmlAttribute(required = true)
    public void setName(String name)
    {
        this.name = name;
    }


    public Size getSize()
    {
        return size;
    }


    @XmlAttribute(required = true)
    public void setSize(Size size)
    {
        this.size = size;
    }


    public String getId()
    {
        return id;
    }


    @XmlID
    @XmlAttribute(required = true)
    public void setId(String id)
    {
        this.id = id;
    }


    public Long getPersistID()
    {
        return persistID;
    }

    @XmlTransient
    public void setPersistID(Long persistID)
    {
        this.persistID = persistID;
    }


    public RacialClassification getClassification()
    {
        return classification;
    }


    @XmlElement(name = "Classification", required = true)
    public void setClassification(RacialClassification classification)
    {
        this.classification = classification;
    }


    public Movement getMovement()
    {
        return movement;
    }


    @XmlElement(name = "Movement", required = true)
    public void setMovement(Movement movement)
    {
        this.movement = movement;
    }


//    @XmlElement(name = "CombatOptions")
//    public CombatOptions getCombatOptions()
//    {
//        return combatOptions;
//    }
//
//
//    public void setCombatOptions(CombatOptions combatOptions)
//    {
//        this.combatOptions = combatOptions;
//    }
//
//
//    /**
//     * @return the advancement
//     */
//    public Advancement getAdvancement()
//    {
//        return advancement;
//    }
//
//
//    /**
//     * @param advancement the advancement to set
//     */
//    @XmlElement(name = "Advancement", required = true)
//    public void setAdvancement(Advancement advancement)
//    {
//        this.advancement = advancement;
//    }

//    @XmlType(name = "CombatOptionsType", namespace = "java:org.rollinitiative.d20.entity")
//    public static class CombatOptions
//    {
//        private int reach;
//
//        ActionOptions actionOptions;
//
//
//        public int getReach()
//        {
//            return reach;
//        }
//
//
//        @XmlAttribute(name = "reach", required = true)
//        public void setReach(int reach)
//        {
//            this.reach = reach;
//        }
//
//
//        /**
//         * @return the actionOptions
//         */
//        public ActionOptions getActionOptions()
//        {
//            return actionOptions;
//        }
//
//
//        /**
//         * @param actionOptions the actionOptions to set
//         */
//        @XmlElement(name = "ActionOptions")
//        public void setActionOptions(ActionOptions actionOptions)
//        {
//            this.actionOptions = actionOptions;
//        }
//
//    }

//    @XmlType(name = "RaceLevelListType", namespace = "java:org.rollinitiative.d20.entity")
//    public static class Advancement
//    {
//        @XmlElement(name = "RacialLevel", required = true)
//        public ArrayList<RacialLevel> levels = new ArrayList<RacialLevel>();
//    }
}
